From c7806015469935ce91e345cd6018ab29749e748c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 8 Sep 2005 16:54:35 +0000 Subject: [PATCH] dhtml update --- ChangeLog | 12 +++ docs/Makefile.am | 27 ++++++- docs/babl.css | 45 ++++++++++- docs/graphics/Makefile.am | 18 ++++- docs/index-static.html.in | 121 ++++++++++++---------------- tests/babl-html-dump.c | 161 +++++++++++++++++++++++++++++--------- 6 files changed, 269 insertions(+), 115 deletions(-) diff --git a/ChangeLog b/ChangeLog index 562c1b9..ea044c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-09-08 Øyvind Kolås + + * AUTHORS: Added Micahel Schumacher, and email addresses. + * docs/index-static.html.in: + * docs/babl.css: + * tests/babl-html-dump.c: (main), (normalize), (show_item), + (hide_item), (each_item), (model_html), (type_html), + (conversion_html), (format_html): Use DHTML for expandable display of + registered data structures. + * docs/graphics/Makefile.am: added web target, and .SILENT option. + * docs/Makefile.am: added .SILENT option. + 2005-09-01 Michael Schumacher * configure.ac: added a check for OS_WIN32 diff --git a/docs/Makefile.am b/docs/Makefile.am index 2d946f1..bf538b6 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,9 +1,10 @@ +.SILENT: SUBDIRS= graphics DIST_SUBDIRS= graphics # The patterns used for html creation in the babl build system # is very small, and should probably be documented in a tutorial. -# +# # # HTML_FILES = index-static.html \ @@ -25,7 +26,10 @@ MAINTAINERCLEANFILES = index.html all: $(HTML_FILES) + + index.html: index-static.html $(top_builddir)/tests/babl_html_dump $(top_srcdir)/AUTHORS $(top_srcdir)/NEWS + echo -n "HTML: $@" cp $< $@ (TMPFILE=`tempfile`;\ $(top_builddir)/tests/babl_html_dump > $$TMPFILE;\ @@ -34,8 +38,29 @@ index.html: index-static.html $(top_builddir)/tests/babl_html_dump $(top_srcdir) $(top_srcdir)/docs/tools/xml_insert.sh $@ AUTHORS $(top_srcdir)/AUTHORS $(top_srcdir)/docs/tools/xml_insert.sh $@ NEWS $(top_srcdir)/NEWS + echo " [OK]" distclean-local: if test $(srcdir) = .; then :; else \ rm -f $(BUILT_EXTRA_DIST); \ fi + + +web: all graphics + echo -n " WEB: " + ping -c 1 $(WEBSITE_HOST) >/dev/null && \ + (\ + scp *.html *.css\ + "$(WEBSITE_HOST):$(WEBSITE_LOCATION)/" >/dev/null && \ + echo -n "."; \ + scp graphics/*.png graphics/*.html\ + "$(WEBSITE_HOST):$(WEBSITE_LOCATION)/graphics/" >/dev/null\ + &&\ + echo "[OK]"\ + ||\ + echo "FAIL scp failed (does dirs exist?)."\ + )\ + || \ + (\ + echo "FAIL $(WEBSITE_HOST) not reachable."\ + ) diff --git a/docs/babl.css b/docs/babl.css index 6caa3f1..79e62ec 100644 --- a/docs/babl.css +++ b/docs/babl.css @@ -52,11 +52,22 @@ margin-bottom: 1em; } - table { - margin-top: 1em; - margin-bottom: 1em; - width: 100%; + div.expander { + border: 1px solid #bbb; + } + div.expander_title { + border-bottom: 1px solid #aaa; + } + div.expander_content { + margin-left: 3em; + display: none; + padding-bottom: 1em; + } + div.expander_content dl{ + margin: 0; + padding: 0; } + table th { font-weight: normal; background-color: #ccc; @@ -89,6 +100,32 @@ color: white; border: 1px solid white; } + + .nopad { + margin :0; + padding:0; + } + + td.component { + background-color: #060; + padding-left: 0.5em; + padding-top: 0.1em; + padding-bottom: 0.1em; + overflow: hidden; + width: 4em; + color: white; + border: 1px solid white; + } + td.type { + background-color: #006; + padding-left: 0.5em; + padding-top: 0.1em; + padding-bottom: 0.1em; + overflow: hidden; + width: 4em; + color: white; + border: 1px solid white; + } span.spacer { float: left; display: block; diff --git a/docs/graphics/Makefile.am b/docs/graphics/Makefile.am index d4d9719..d87b137 100644 --- a/docs/graphics/Makefile.am +++ b/docs/graphics/Makefile.am @@ -1,3 +1,5 @@ +.SILENT: + if HAVE_INKSCAPE PNG_FILES = \ babl-a4poster.png \ @@ -20,18 +22,30 @@ MAINTAINERCLEANFILES = $(PNG_FILES) all: $(MAINTAINERCLEANFILES) +INKSCAPE_CMD = echo -n " SVG: $@" ;\ + $(INKSCAPE) -e $@ $< 2&>/dev/null\ + &&\ + echo " [OK]"\ + ||\ + echo " FAIL" if HAVE_INKSCAPE dist-check-inkscape: %.png: %.svg - $(INKSCAPE) -e $@ $< + $(INKSCAPE_CMD) +#-e $@ $< 2>/dev/null # the png version of the a4 poster is used as a webgraphic # , thus it is rendered with the background alpha set to # 0.0 babl-a4poster.png: babl-a4poster.svg - $(INKSCAPE) -e $@ $< -w 256 -y 0 + echo -n " SVG: $@" ;\ + $(INKSCAPE) -e $@ $< -w 256 -y 0 2&>/dev/null\ + &&\ + echo " [OK]"\ + ||\ + echo " FAIL" else dist-check-inkscape: @echo "*** inkscape must be available in order to make dist" diff --git a/docs/index-static.html.in b/docs/index-static.html.in index 9be7002..ff707ef 100644 --- a/docs/index-static.html.in +++ b/docs/index-static.html.in @@ -14,6 +14,48 @@ + + @@ -35,14 +77,10 @@
  •   Color models
  •   Pixel formats
  • Dependencies
  • -
  •   Core
  • -
  •   Extensions
  • Source
  • Usage
  • Extending
  • -
  • TODO
  • -
  •   Core
  • -
  •   Extensions
  • +
  • Todo
  • Copyright
  •   Authors
  • @@ -70,23 +108,13 @@

    Core

    • Small API for simple use cases
    • -
    • Specification of new formats
    • Planar and linear buffers
    • Thread safety for processing.
    • -
    • Extension and introspection of formats, +
    • Extendable and introspectable formats, color models, components and datatypes
    • -
    • Horizontal an vertical subsampling (for - implementing 4:2:2 4:2:0 4:1:1 etc. chroma subsampling)
    • -
    • Reference 64bit floating point conversions for data types and color models. - -

      Note: This portion of babl has still not received rigorous - testing, the main development of babl is still focused on internal - infrastructure work. As the development of babl allows, initial tests - and usage of babl is welcome; as it would help kill of random - mystypes in constants and such earlier, and make it a more valid - actual regression suite. -

      +
    • Reference 64bit floating point conversions for + data types and color models.
    @@ -108,9 +136,6 @@ -

    - The extension api is not going to be frozen until after the 1.0 release. -

    @@ -119,16 +144,8 @@

    Babl is intended to be a low level infrastructure library and thus strives for few dependencies and thus portability.

    - -

    Core

    -
      -
    • The C Standard library.
    • -
    - - -

    Extensions

      -
    • libdl - dynamic modules. (planned)
    • +
    • libdl (win32 uses separate solution)
    @@ -198,20 +215,16 @@

    -

    TODO

    -

    Core

      -
    • Speed up name resolution in babl-db.h (using a hash table, and - probably also a id table)
    • -
    • Meta level optimizations.
    • Compile and/or runtime profiling. (The speed of conversions is bound to 'wobble', according to architecture, compiler flags, concurrently running processes and phase of moon.)
    • -
    • Subsampling support
    • -
    • Support for datatypes that are not a multiple of 8bit.
    • +
    • Horizontal and vertical subsampling (for + implementing 4:2:2 4:2:0 4:1:1 etc. chroma subsampling)
    • Thread safety for mutations of the type system.
    • +
    • Support for datatypes that are not a multiple of 8bit.
    - -

    Extensions

    -
      -
    • Dynamic modules - babl will probably look in a colon - seperated list of paths to search sequentially for modules. - The default assumed value is -
      BABL_PATH="/usr/lib/babl/:/usr/local/lib/babl:(HOME)/.local/lib/babl:$(HOME)/lib/babl".
      -          
      - NB: the modules will be loaded from the directories pointed to by - the path in reverse order, this should allow the user to override - system wide definitions for types, models and formats. - -

      currently the extensions are hardcoded to be installed in /home/pippin/.babl/ - and the only extensions looked for are naive-CMYK.so and CIE-Lab.so this will change - shortly. Look in babl/babl-extension.c (bottom) and extensions/Makefile.in to - change it if you so desire.

      - - -
    • - -
    - -

    Copyright

    @@ -264,15 +253,7 @@ cp babl/babl-classes.c babl/babl-internal.c

    Authors

    -
    -
    Maintainer:
    -
    Øyvind Kolås
    -
    Original author:
    -
    Øyvind Kolås
    -
    Contributors:
    -
              
    -
    -
    + /babl-@BABL_VERSION@ diff --git a/tests/babl-html-dump.c b/tests/babl-html-dump.c index d33aab5..eb2e8e7 100644 --- a/tests/babl-html-dump.c +++ b/tests/babl-html-dump.c @@ -22,37 +22,120 @@ static void model_html (Babl *babl); static void type_html (Babl *babl); static void format_html (Babl *babl); +static void conversion_html (Babl *babl); static int each_item (Babl *babl, void *user_data); +static int show_item (Babl *babl, + void *user_data); +static int hide_item (Babl *babl, + void *user_data); + int main (void) { babl_init (); - - printf ("\n"); - printf ("\n"); + printf ("
    +"); + + printf ("-"); + + printf ("
    "); + printf ("
    \n"); babl_type_each (each_item, NULL); - printf ("
    \n"); - printf ("\n"); + printf ("\n"); + printf ("\n"); + + printf ("
    "); + printf ("
    \n"); babl_model_each (each_item, NULL); - printf ("
    \n"); - printf ("\n"); + printf ("\n"); + printf ("\n"); + + + printf ("
    "); + printf ("
    \n"); babl_format_each (each_item, NULL); - printf ("
    Data typebitsbytes
     
    Color modelcomponents
     
    Pixel formatbytes/pixelcolor modelbands
    \n"); + printf ("\n"); + printf ("\n"); + + + printf ("
    "); + printf ("
    \n"); + babl_conversion_each (each_item, NULL); + printf ("
    \n"); + printf ("
    \n"); babl_destroy (); return 0; } + +static char normalized_buf[512]; + +const char *normalize(const char *str) +{ + char *s = normalized_buf; + strcpy (normalized_buf, str); + + while (*s) + { + if ( (*s >= 'a' && *s <= 'z') || + (*s >= 'A' && *s <= 'Z') || + (*s >= '0' && *s <= '9')) + { + } + else + { + *s='_'; + } + s++; + } + return normalized_buf; +} + + +static int +show_item (Babl *babl, + void *user_data) +{ + printf ("show(\"x_%s\");", normalize(babl->instance.name)); + return 0; +} + + +static int +hide_item (Babl *babl, + void *user_data) +{ + printf ("hide(\"x_%s\");", normalize(babl->instance.name)); + return 0; +} + static int each_item (Babl *babl, - void *user_data) + void *user_data) { - printf ("\t%s", babl->instance.name); + printf ("
    "); + printf ("\n", + normalize(babl->instance.name), babl->instance.name); + printf ("
    \n", + normalize (babl->instance.name)); + switch (babl->class_type) { @@ -65,11 +148,18 @@ each_item (Babl *babl, case BABL_FORMAT: format_html (babl); break; + case BABL_CONVERSION: + case BABL_CONVERSION_LINEAR: + case BABL_CONVERSION_PLANE: + case BABL_CONVERSION_PLANAR: + conversion_html (babl); + break; default: break; } - printf ("\n"); + printf ("
    \n"); + printf ("
    \n"); return 0; } @@ -78,19 +168,29 @@ model_html (Babl *babl) { int i; - printf (""); + printf ("
    "); + printf ("
    components
    "); + for (i=0; i< babl->model.components; i++) { - printf ("%s 
    ", BABL(babl->model.component[i])->instance.name ); + printf ("", + BABL(babl->model.component[i])->instance.name ); } - printf (""); + printf ("
    %s
    "); } static void type_html (Babl *babl) { - printf ("%i", babl->type.bits); - printf ("%i", babl->type.bits / 8); + printf ("
    bits
    %i
    ", babl->type.bits); + printf ("
    bytes
    %i
    ", babl->type.bits / 8); +} + + +static void +conversion_html (Babl *babl) +{ + printf ("\n"); } static void @@ -98,32 +198,17 @@ format_html (Babl *babl) { int i; - printf (""); - printf ("%i", babl->format.bytes_per_pixel); - printf (""); - printf (""); - printf ("%s", BABL(babl->format.model)->instance.name ); - printf (""); - printf (""); + printf ("
    "); + printf ("
    bytes/pixel
    %i
    ", babl->format.bytes_per_pixel); + printf ("
    model
    %s
    ", BABL(babl->format.model)->instance.name ); + printf ("
    components
    "); + for (i=0; i< babl->format.components; i++) { - printf ("%s %s 
    ", + printf ("", BABL(babl->format.type[i])->instance.name, BABL(babl->format.component[i])->instance.name ); } - printf (""); -#if 0 - int i; - babl_log ("\t\tplanar=%i", babl->format.planar); - babl_log ("\t\tbands=%i", babl->format.bands); - - for (i=0; i< babl->format.bands; i++) - { - babl_log ("\t\tband[%i] type='%s' component='%s' sampling='%s'", - i, babl->format.type[i]->instance.name, - babl->format.component[i]->instance.name, - babl->format.sampling[i]->instance.name); - } -#endif + printf ("
    %s%s
    "); } -- 2.30.2